﻿@model RBS.Core.Model.U_User_Integration
@{
    ViewBag.Title = "赠送积分";
    Layout = "~/Views/Shared/_UserLayout.cshtml"; 
}

<!--导航栏-->
@{
    @Html.Partial("_Location");
}
<!--/导航栏-->

 
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true) 
    <div class="tab-content"> 
        <dl style="display: none">
            <dt>用户ID</dt>
            <dd>  
                @Html.TextBoxFor(model => model.UserId, null, new { @class = "input normal" })
                <span class="Validform_checktip">*用户ID</span> 
            </dd>
        </dl>
        <dl  >
            <dt>当前积分</dt>
            <dd>  
                 @ViewBag.IntegralCount
            </dd>
        </dl>
        <dl>
            <dt>赠送积分</dt> 
            <dd> 
                @Html.TextBoxFor(model => model.Point, null, new { @class = "input normal",datatype="gift", IntegralCount=@ViewBag.IntegralCount,errormsg="赠送积分错误", nullmsg="请填写需要赠送的积分！" })
                 <br/> <span class="Validform_checktip">
                    当前赠送积分不能大于您当前积分总数！赠送积分不能为空并且大于1分； 
                </span> 
            </dd>
        </dl> 
    </div>
    <!--/内容-->

    <!--工具栏-->
    <div class="page-footer">
        <div class="btn-list">
            <input type="submit" value="赠送" class="btn" />
            <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript: history.back(-1);" />

        </div>
        <div class="clear"></div>
    </div>
    <!--/工具栏--> 
    
    <script>
        $(function() {  
            $("form").Validform({
                tiptype: 2,
                datatype: { 
                    "gift":function(gets,obj,curform,regxp) { 
                        var integralCount = curform.find("#Point").attr("IntegralCount"); 
                        if (parseInt(integralCount) - parseInt(gets) < 0) { 
                            return false;
                        }
                        if (parseInt(gets) <= 0 || gets == "") { 
                            return false;
                        }
                        return true;
                    }	
                },
                ajaxPost:true
            });


        })
    </script>
        
}










